const { defineConfig } = require('@vue/cli-service');
const path = require('path')
function resolve(dir) {
  return path.join(__dirname, dir)// path.join(__dirname)设置绝对路径
}
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false, //关闭语法检查
  // 基本路径
  publicPath: '/',
  // 输出文件目录
  outputDir: 'dist',
  devServer: {
    proxy: {
      '/caiyun': {
        target: 'http://api.caiyunapp.com',
        changeOrigin: true,
        pathRewrite: {
          '^/caiyun': ''
        }
      }
    }
  },
  chainWebpack: (config) => {
    config.module
      .rule('geojson')
      .test(/\.geojson$/)
      .use('json-loader')
      .loader('json-loader')
      .end();
    config.resolve.alias
      .set('@', path.resolve(__dirname, 'src')) // 设置别名 '@' 为 'src' 目录的绝对路径
      .set('common', path.resolve(__dirname, 'src/common')) // 设置别名 'components' 为 'src/components' 目录的绝对路径
  }
});
